<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/index.xhtml">
        <ui:define name="title"/>
        <ui:define name="body">
            <h:form>
                <p:panel id="panel" header="#{bundle.EditTblPersonaTitle}" style="margin-bottom:5px;">

                    <h:panelGroup id="messagePanel" layout="block">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                    </h:panelGroup>

                    <h:panelGrid columns="3" cellpadding="3">
                        <p:outputLabel value="#{bundle.EditTblPersonaLabel_documento}" for="documento" />
                        <p:inputText id="documento" value="#{tblPersonaController.selected.documento}" title="#{bundle.EditTblPersonaTitle_documento}" required="true" requiredMessage="#{bundle.EditTblPersonaRequiredMessage_documento}" disabled="true"/>
                        <br/>

                        <p:outputLabel value="#{bundle.EditTblPersonaLabel_nombre}" for="nombre" />
                        <p:inputText id="nombre" value="#{tblPersonaController.selected.nombre}" title="#{bundle.EditTblPersonaTitle_nombre}" required="true" requiredMessage="#{bundle.EditTblPersonaRequiredMessage_nombre}">
                            <f:validateLength minimum="2" />
                        </p:inputText>
                        <p:message for="nombre" />

                        <p:outputLabel value="#{bundle.EditTblPersonaLabel_apellido1}" for="apellido1" />
                        <p:inputText id="apellido1" value="#{tblPersonaController.selected.apellido1}" title="#{bundle.EditTblPersonaTitle_apellido1}" required="true" requiredMessage="#{bundle.EditTblPersonaRequiredMessage_apellido1}">
                            <f:validateLength minimum="2" />
                        </p:inputText>
                        <p:message for="apellido1" />

                        <p:outputLabel value="#{bundle.EditTblPersonaLabel_apellido2}" for="apellido2" />
                        <p:inputText id="apellido2" value="#{tblPersonaController.selected.apellido2}" title="#{bundle.EditTblPersonaTitle_apellido2}" />
                        <br/>

                        <p:outputLabel value="#{bundle.EditTblPersonaLabel_email}" for="email" />
                        <p:inputText id="email" value="#{tblPersonaController.selected.email}" title="#{bundle.EditTblPersonaTitle_email}" />
                        <br/>

                        <p:outputLabel value="#{bundle.EditTblPersonaLabel_telefono}" for="telefono" />
                        <p:inputText id="telefono" value="#{tblPersonaController.selected.telefono}" title="#{bundle.EditTblPersonaTitle_telefono}" required="true" requiredMessage="#{bundle.EditTblPersonaRequiredMessage_telefono}">
                            <f:validateLength minimum="2" />
                        </p:inputText>
                        <p:message for="telefono" />

                        <p:outputLabel value="#{bundle.EditTblPersonaLabel_celular}" for="celular" />
                        <p:inputText id="celular" value="#{tblPersonaController.selected.celular}" title="#{bundle.EditTblPersonaTitle_celular}" required="true" requiredMessage="#{bundle.EditTblPersonaRequiredMessage_celular}">
                            <f:validateLength minimum="2" />
                        </p:inputText>
                        <p:message for="celular" />

                        <p:outputLabel value="#{bundle.EditTblPersonaLabel_direccion}" for="direccion" />
                        <p:inputText id="direccion" value="#{tblPersonaController.selected.direccion}" title="#{bundle.EditTblPersonaTitle_direccion}" required="true" requiredMessage="#{bundle.EditTblPersonaRequiredMessage_direccion}">
                            <f:validateLength minimum="2" />
                        </p:inputText>
                        <p:message for="direccion" />

                    </h:panelGrid>
                    <p:commandButton action="#{tblPersonaController.update}" value="#{bundle.EditTblPersonaSaveLink}" update="panel"/>
                    <p:commandButton action="#{tblPersonaController.prepareList}" value="#{bundle.EditTblPersonaShowAllLink}" immediate="true"/>

                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
